package models

import (
	"gorm.io/gorm"
	"week3/projectsrv/global"
)

type Goods struct {
	gorm.Model
	GoodsName  string
	GoodsPrice float64
	GoodsStock int
	GoodsDesc  string
	GoodsSales int
}
type Order struct {
	gorm.Model
	OrderSn    string
	TotalPrice float64
	Status     int
}

func Migrate() {
	err := global.DB.AutoMigrate(&Goods{}, &Order{})
	if err != nil {
		panic(err)
	}
}
